<div class="am-u-sm-12 widget" style="margin:10px ;">
	<div class="am-u-sm-12">
		<form class="am-form tpl-form-border-form tpl-form-border-br" action="" method="get">
			<div class="am-form-group am-u-sm-2">
				<select name="work_state" data-am-selected="{btnWidth: '100%',btnSize: 'sm'}">
					<option value="0">全部</option>
					<option value="1">执行任务中</option>
					<option value="2">有预约订单</option>
					<option value="3">听单中</option>
					<option value="4">下班</option>
				</select>
			</div>
			<div class="am-form-group am-u-sm-2">
				<input type="hidden" class="car_rental_id" name="car_rental_id" value="{$item.car_rental_id}" />
				<input type="text" class="am-form-field tpl-form-no-bg  car_rental" style="line-height: 21px;" value="{$Think.get.car_rental_name}" placeholder="点击选择公司/单位" readonly="">
			</div>

			<div class="am-form-group am-u-sm-2">
				<input type="text" class="tpl-form-input" name="name" placeholder="司机姓名" value="{$Think.get.name}">
			</div>
			<div class="am-form-group am-u-sm-2">
				<input type="text" class="tpl-form-input" name="driver_no" placeholder="司机工号" value="{$Think.get.driver_no}">
			</div>
			<div class="am-form-group am-u-sm-2">
				<input type="text" class="tpl-form-input" name="number" placeholder="车牌号" value="{$Think.get.number}">
			</div>
			<div class="am-form-group am-u-sm-2">
				<button type="submit" class="am-btn am-btn-sm am-btn-primary am-radius" style="margin-top: -2px;">查询</button> {if $op == 'search'} {else/}
				<a href="/admin/driver/add" class="am-btn am-btn-sm am-btn-primary am-radius" style="margin-top: -2px;">添加司机</a>
				{/if}
			</div>

		</form>
	</div>
	<div style="padding: 10px;" class="am-u-sm-12">
		<div><button style="float: right;" type="button" class="am-btn am-btn-default am-radius am-btn-xs" style="margin-top: -2px;">导出文件</button></div>
		<table width="100%" class="am-table am-table-compact am-text-nowrap tpl-table-black ">
			<thead>
				<tr>
					{if $op == 'search'}
					<th>操作</th>
					{else/}
					<th><input type="checkbox" /></th>
					{/if}
					<th>姓名</th>
					<th>状态</th>
					{if $op == 'search'} {else/}
					<th>状态操作</th>
					{/if}
					<th>电话</th>
					<th>所属公司</th>
					<th>关联车辆</th>
					{if $op == 'search'} {else/}
					<th>关联操作</th>
					{/if}
					<th>驾龄</th>
					<th>余额</th>
					<th>星级</th>
					<th>司机状态</th>
					{if $op == 'search'} {else/}
					<th>操作</th>
					{/if}
				</tr>
			</thead>
			<tbody>
				{foreach $list as $key => $item}
				<tr data-id="{$item.driver_id}">
					{if $op == 'search'}
					<td>
						<div class="tpl-table-black-operation">
							<a href="javascript:;" class="choose" data-id="{$item.driver_id}" data-name="{$item.name}">
								<i class="am-icon-pencil"></i> 选中
							</a>
						</div>
					</td>
					{else/}
					<td><input type="checkbox" /></td>
					{/if}
					<td>
						<a href="{:url('details',['driver_id'=>$item.driver_id])}">{$item.name}</a>
					</td>
					<td class="am-text-{$item.state==9?'danger':'success'}">{$item.state==9?'已禁用':'已启用'}</td>
					{if $op == 'search'} {else/}
					<td>
						<div class="tpl-table-black-operation">
							{if $item.state == 9}
							<a href="javascript:;" class="startusing" data-method="startusing">
								<i class="am-icon-pencil"></i> 启用
							</a>
							{else/}
							<a href="javascript:;" class="tpl-table-black-operation-del forbidden" data-method="forbidden">
								<i class="am-icon-trash"></i> 禁用
							</a>
							{/if}
						</div>
					</td>
					{/if}
					<td>{$item.phone}</td>
					<td>{$item.car_rental_name}</td>
					<td>
						<div class="am-u-sm-12 cl-p">
							<div class="am-u-sm-6 cl-p">{$item.number}</div>
							<div class="am-u-sm-6 cl-p">
								<div class="tpl-table-black-operation">
									<a class="tpl-table-black-operation-del unbind">
										<i class="am-icon-trash"></i> 解除
									</a>
								</div>
							</div>
						</div>
					</td>
					{if $op == 'search'} {else/}
					<td>
						<div class="tpl-table-black-operation">
							<a class="bind">
								<i class="am-icon-pencil"></i> 关联车辆
							</a>
							
						</div>
					</td>
					{/if}
					<td>{$item.driving_age}</td>
					<td>{$item.balance}</td>
					<td>{$item.star}</td>
					<td>{$work_states[$item.work_state]}</td>
					{if $op == 'search'} {else/}
					<td>
						<div class="tpl-table-black-operation">

							<a href="{:url('edit',['driver_id'=>$item.driver_id])}">
								<i class="am-icon-pencil"></i> 编辑
							</a>
							<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
								<i class="am-icon-pencil"></i> 删除
							</a>
							<a href="javascript:;" class="showmap" data-method="showmap">
								<i class="am-icon-map"></i> 当前位置
							</a>
						</div>
					</td>
					{/if}
				</tr>
				{/foreach}
				<!-- more data -->
			</tbody>
		</table>
		<input type="hidden" class="driver_id" />
		{if $op == 'search'} {else/}
		<div><button style="float: left;" type="button" class="am-btn am-btn-primary am-radius am-btn-xs" style="margin-top: -2px;">短信发送</button></div>
		{/if}
		<div class="am-u-lg-12 am-cf">
			<div class="am-fr">
				{$pager}
			</div>
		</div>
	</div>

</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>